package com.csdj.t309springboot.mapper;
import com.csdj.t309springboot.entity.IntegralRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 积分记录表 Integral record Mapper 接口
 * </p>
 *
 * @author 谭湛宇
 * @since 2022-01-13
 */
public interface IntegralRecordMapper extends BaseMapper<IntegralRecord> {

    public List<IntegralRecord> findIntegralRecordListByUserId(int userId);
    @Select("select id, user_id,integral_source, integral_number,integral_balance, integral_change, used,modify_time, expire " +
            " from integral_record where user_id = #{userId} ORDER BY `modify_time` desc LIMIT 1")
    public IntegralRecord findIntegralRecordInfoByUserId(int userId);

}
